﻿using System;
using System.Collections.Generic;
using System.Text;

namespace designmodule.constructionmodule.Builder
{
    public abstract class Builder
    {
        public abstract void BuildPartA();
        public abstract void BuildPartB();
        public abstract Product Getresult();
    }

    public class ConcretBuilderA:Builder
    {
        public ConcretBuilderA()
        {
            Product = new Product();
        }

        public Product Product { get; private set; }
        public override void BuildPartA()
        {
            Product.Add("part A");
        }

        public override void BuildPartB()
        {
            Product.Add("part B");
        }

        public override Product Getresult()
        {
            return Product;
        }
    }

    public class ConcretBuilderB : Builder
    {
        public ConcretBuilderB()
        {
            Product = new Product();
        }

        public Product Product { get; private set; }
        public override void BuildPartA()
        {
            Product.Add("part 1");
        }

        public override void BuildPartB()
        {
            Product.Add("part 2");
        }

        public override Product Getresult()
        {
            return Product;
        }
    }
}
